<?php
def("amicitia/persistencia/excepciones/","PersistenciaException");
/**
 * Excepción disparada al ocurrir un error a nivel de base de datos.
 * 
 * @author Willy A. Kuster
 */
class QueryException extends PersistenciaException {

	private $query;
	private $error;

	public function __construct($query, $error, $message = "Error en base de datos: '%s' luego de ejecutar el query: '%s'", $code = 0, Exception $previous = null) {
		$this->query = $query;
		$this->error = $error;
		parent::__construct(sprintf($message, $error, $query), $code, $previous);
	}

	public function getQuery(){
		return $this->query;
	}
	
	public function getError(){
		return $this->error;
	}

}
?>